﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models {
    import flash.geom.*;
    import net.wooga.pets.models.vo.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.utils.*;

    public class LetterModel extends Actor {

        private var _letter:Array;

        public function LetterModel(){
            this._letter = new Array();
            super();
            this.initLetters();
        }
        private function initLetters():void{
            this._letter.push(new LetterVO(GameConstants.LETTER_MISSIONS, new Point(100, 250)));
            this._letter.push(new LetterVO(GameConstants.LETTER_INVITE_FRIEND, new Point(300, 250)));
            this._letter.push(new LetterVO(GameConstants.LETTER_BUILD_TREATMENT_MENTAL, new Point(450, 250), GameConstants.LETTER_POPUP_LAYOUT_A, GameConstants.TYPE_TREATMENT_MENTAL));
            this._letter.push(new LetterVO(GameConstants.LETTER_BUILD_TREATMENT_PHYSICAL, new Point(450, 250), GameConstants.LETTER_POPUP_LAYOUT_A, GameConstants.TYPE_TREATMENT_PHYSICAL));
            this._letter.push(new LetterVO(GameConstants.LETTER_BUILD_REHA_SPORT, new Point(450, 250), GameConstants.LETTER_POPUP_LAYOUT_A, GameConstants.TYPE_REHA_SPA));
            this._letter.push(new LetterVO(GameConstants.LETTER_BUILD_TREATMENT_COSMETICS, new Point(450, 250), GameConstants.LETTER_POPUP_LAYOUT_A, GameConstants.TYPE_TREATMENT_COSMETIC));
            this._letter.push(new LetterVO(GameConstants.LETTER_BUILD_REHA_FUN, new Point(450, 250), GameConstants.LETTER_POPUP_LAYOUT_A, GameConstants.TYPE_REHA_FUN));
            this._letter.push(new LetterVO(GameConstants.LETTER_KIOSK, new Point(200, 250), GameConstants.LETTER_POPUP_LAYOUT_B));
            this._letter.push(new LetterVO(GameConstants.LETTER_FONTAIN, new Point(300, 250), GameConstants.LETTER_POPUP_LAYOUT_B));
            this._letter.push(new LetterVO(GameConstants.LETTER_KINDERGARTEN, new Point(400, 250), GameConstants.LETTER_POPUP_LAYOUT_B));
            this._letter.push(new LetterVO(GameConstants.LETTER_UPDATES, new Point(400, 250), GameConstants.LETTER_POPUP_LAYOUT_C));
            this._letter.push(new LetterVO(GameConstants.LETTER_QUEUE, new Point(400, 250), GameConstants.LETTER_POPUP_LAYOUT_C));
            this._letter.push(new LetterVO(GameConstants.LETTER_NEW_PETS, new Point(400, 250), GameConstants.LETTER_POPUP_LAYOUT_C));
        }
        public function setLettersReadState(_arg1:Array):void{
            var _local3:String;
            var _local4:LetterVO;
            var _local2:int;
            while (_local2 < _arg1.length) {
                _local3 = _arg1[_local2];
                _local4 = Arrays.findByAttribute(this._letter, "id", _local3);
                if (_local4){
                    _local4.isRead = true;
                };
                _local2++;
            };
        }
        public function getLetterById(_arg1:String):LetterVO{
            return ((Arrays.findByAttribute(this._letter, "id", _arg1) as LetterVO));
        }
        public function readLetter(_arg1:String):void{
            this.getLetterById(_arg1).isRead = true;
        }

    }
}//package net.wooga.pets.models 
